object IfElseIfDemo extends App{
  //定义学生综合分评分
  val compositeScore: Int = 85
  //if-else if-else多分支：处理多级条件
  val priority = if (compositeScore >=90) {
    "优先级A(优先录取)"
  } else if (compositeScore >= 80) {
    "优先级B(正常录取)"
  } else if (compositeScore >= 70) {
    "优先级C(候补录取)"
  } else  {
    "优先级D(不录取)"
  }
  println (s"学生综合评价分为$compositeScore 分，报名优先级：$priority")
  //测试其他评分
  val scores = List(92,75,68)
  for (score <- scores) {
    val p = if (score >=90) "A"
            else if (score >=80) "B"
            else if (score >=70) "C"
            else "D"
    println(s"评分$score 分 -> 优先级$p")

  }

}
